<template>
  <div>
    <MyHeader bgColor="pink" fontColor="orange" title="爱车" />
    <div class="list" style="padding: 45px 0 50px">
      <MyGoods v-for="item,index in list" :key="index" :goodsList="item"/>
    </div>
    <MyFooter :arr="list"/>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader";
import MyFooter from "./components/MyFooter";
import MyGoods from "./components/MyGoods";
export default {
  data() {
    return {
      list: [],
    };
  },
  async created() {
    const resp = await this.$http({
      method: "GET",
      url: "/api/cart",
    });
    this.list = resp.data.list;
    // console.log(this.list);
  },
  components: {
    MyHeader,
    MyFooter,
    MyGoods,
  },
};
</script>

<style>
</style>